<?php

namespace app\common\middleware;

use app\common\component\ErrorCode;
use \app\common\component\Redis;

/**
 * 身份认证中间件中间件
 * Class ThrottleMiddleware
 * @package app\common\middleware
 */
class AuthenticateMiddleware
{
    /**
     * 构造函数
     * ThrottleMiddleware constructor.
     */
    private function __construct()
    {}

    /**
     * 单例
     * @param bool $newInstance
     * @return null|static
     */
    public static function getInstance($newInstance = false)
    {
        if (is_null(static::$instance) || $newInstance) {
            self::$instance = new static();
        }

        return self::$instance;
    }
}